package com.minelx.datamicroscope.core.query.literalcondition;

import com.minelx.datamicroscope.core.condition.KeyOperandCondition;
import com.minelx.datamicroscope.core.condition.RawCondition;
import com.minelx.datamicroscope.core.query.RawConditionFactory;
import io.gitee.minelx.filesystem.TempPath;

class KeyOperandLiteralCondition implements LiteralCondition {

    private final RawConditionFactory rawConditionFactory;

    private final KeyOperandCondition keyOperandCondition;

    KeyOperandLiteralCondition(RawConditionFactory rawConditionFactory, KeyOperandCondition keyOperandCondition) {
        this.rawConditionFactory = rawConditionFactory;
        this.keyOperandCondition = keyOperandCondition;
    }

    @Override
    public RawCondition toRawCondition(TempPath tempDir) {
        return rawConditionFactory.extraToRawCondition(keyOperandCondition);
    }
}
